<%@page contentType="text/html;charset=UTF-8" %><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">
<%@page import="be.destin.skos.core.SkosManager" %>
<%@page import="be.destin.skos.html.SkosHtmlManager" %>
<%@page import="be.destin.skos.html.SkosHtmlTable" %>
<%@page import="be.destin.skos.html.LocalError" %>
<%@page import="be.destin.skos.core.SchemeInterface" %>
<%@page import="be.destin.skos.core.SchemeUsage" %>
<%@page import="be.destin.skos.core.ConceptScheme" %>
<%@page import="be.destin.skos.core.CollectionScheme" %>
<%@page import="be.destin.skos.core.Predicate" %>
<%@page import="be.destin.skos.core.Concept" %>
<%@page import="be.destin.skos.core.Term" %>
<%@page import="be.destin.skos.core.TermFormat" %>
<%@page import="be.destin.skos.core.Url" %>
<%@page import="be.destin.skos.core.Notation" %>
<%@page import="be.destin.skos.core.ReferringApplicationList" %>
<%@page import="be.destin.skos.core.LinkedConcept" %>
<%@page import="be.destin.skos.core.LocalLinkedConcept" %>
<%@page import="be.destin.skos.view.SkosView" %>
<%@page import="be.destin.skos.view.SkosViewType" %>
<%@page import="be.destin.skos.view.SkosViewManager" %>
<%@page import="be.destin.rdf.changes.SkosStatement" %>
<%@page import="be.destin.util.RunCommand" %>
<%@page import="be.destin.util.Util" %>
<%@page import="java.util.List" %>
<%@page import="java.util.Map" %>
<%@page import="java.util.LinkedList" %>
<%@page import="java.util.HashSet" %>
<%@page import="java.util.TreeMap" %>
<%@taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<%	 
   SkosHtmlManager skosHtmlManager = SkosHtmlManager.getAskosiSessionInstance(request);
   SkosManager skosManager = skosHtmlManager.getSkosManager();
   String language = skosHtmlManager.getLanguage();
   String conceptCode = request.getParameter("about");
   String independant = request.getParameter("independant");
   String framing = request.getParameter("framed");
   boolean framed = framing != null && framing.equalsIgnoreCase("yes");
   if (independant != null && independant.equalsIgnoreCase("yes")) framed = false;
   framing = "";
   if (framed) framing = "&framed=yes";
   String fixingPage = request.getParameter("fixed");
   boolean fixedPages = fixingPage != null && fixingPage.equalsIgnoreCase("yes");
   if (fixedPages) framing = framing+"&fixed=yes";
   String expanding = request.getParameter("expanded");
   boolean expanded = expanding != null && expanding.equalsIgnoreCase("yes");
   String theProperty = request.getParameter("property");
   String theLabel = request.getParameter("literal");
   String theLanguage = request.getParameter("literallanguage");
   String theNotation = request.getParameter("notation");
   String linked = request.getParameter("rel");
   String subRel = request.getParameter("relqualifier");
%>
<html>
<head>
<link rel="stylesheet" type="text/css" href="<%=request.getContextPath()%>/css/jqueryui.css" />
<link rel="stylesheet" type="text/css" href="<%=request.getContextPath()%>/css/askosi.css" />
<link rel="stylesheet" type="text/css" href="<%=request.getContextPath()%>/css/ajaxtags.css" />
<title>Concept <%=conceptCode%></title>
	<script type="text/javascript" src="js/jquery-1.7.2.js"></script>
    <script type="text/javascript" src="js/tablescroll.js"></script>
</head>
<body class="contentpage">
<%
   Concept aConcept = (Concept)skosManager.getScheme_Concept(conceptCode);
   if (aConcept != null) {
        ConceptScheme aScheme = aConcept.getInScheme();	   
	    String statusCode = aConcept.getStatus();
	    if (statusCode == null || statusCode.isEmpty()) statusCode = "";
	    else {
			Concept aStatus = (Concept)skosManager.getScheme_Concept("status_"+statusCode);
			if (aStatus != null) statusCode = skosHtmlManager.toHtmlImage(aStatus.getIconAdapted(skosHtmlManager),aStatus.getAbout(),false);
	    }
	   
   if (framed) {
%><script language="JavaScript">
parent.parent.parent.focusFrame(this);
</script><%
   }%>
<%=statusCode%>Concept <%=skosHtmlManager.toHtmlImage(aConcept.getIconAdapted(skosHtmlManager),aConcept.getAbout(),false)%><span class="math">&#8865;</span><%=aConcept.getAbout()%>
<%
	  if (aConcept.getUrl() != null) {
		for (Url anUrl: aConcept.getUrl()) {
	      %> &nbsp; <a href="<%=anUrl.getValue()%>" target="conceptURL"><span class="language"><%=anUrl.getLang()%></span> <%=anUrl.getValue()%></a> &nbsp; <%
		}
      }
%>
<%if (aConcept.getDepth() > 0) {%>&#8615;<%=aConcept.getDepth()%><%}%>
<span class="math">&isin;</span>
<img src="image/conceptscheme16.gif" border="0"/> <%=skosHtmlManager.toHtmlImage(aScheme.getIconAdapted(skosHtmlManager),aScheme.getAbout(),false)%><a href="view.jsp?scheme=<%=aScheme.getAbout()%><%=framing%>" target="askosi_scheme"><%=aScheme.getAbout()%></a>:
	    <br style="clear:both"/>
     <big style="border:solid 1px; padding:0px 5px 0px 5px;"><img src="image/concept16.gif" border="0"/> <%=aConcept.toHtmlLabel(skosHtmlManager)%></big><a href="<%=aConcept.getAskosiUrl(skosHtmlManager,"askosi")%>&edit=yes"><img<%=skosHtmlManager.askosiIcon("edit")%> border="0"/></a></h4>
	 <p>Subject: <%=conceptCode%>, <%=SkosStatement.findSkosResource(skosManager,null,aConcept.stringValue())%>
	 <p>Predicate: <%=theProperty%><% Predicate aPred = Predicate.find(aConcept,theProperty);%>, <%=aPred%>
	 <p>Literal: <%=theLabel%>
	 <p>Language: <%=theLanguage%>
	 <p>Notation: <%=theNotation%>
	 <p>Object: <%=linked%>
	 <p>RelationQualifier: <%=subRel%>
	 <P>RDF Statement: 
	 <%SkosStatement aStatement = SkosStatement.makeSkosStatement(skosManager,aConcept.stringValue(),theProperty,subRel,TermFormat.REGULAR,theLabel,theLanguage,theNotation,linked);
	 Object aRelat = aStatement.findExistingRelation(); String xxx=""; if (aRelat!=null) {xxx = aRelat.getClass().getName();}
	 %><%=aStatement%>, Relation=<%=xxx%>
	 <% if (aRelat instanceof Term) {
	    Term aTerm = (Term)aRelat;
	 %><p> PrefLabel=<%=aTerm%>-->XXX<% aTerm.setValue("XXX"); } else {
		LinkedConcept aLink = (LinkedConcept)aRelat;%>
	 <p> Rel=<%=aLink%>-->Remove!<%aStatement.removeRelation(aLink);}%>
<p>Current status:
<p>Action: change, deprecate, 
<p>	 
	 
<% } %>
</body>
</html>